package com.test.dao;

import com.test.bean.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserDao{

    @Select("select * from demo.user WHERE userName = #{name}")
    @Results({
           @Result(property = "id",  column = "id"),
           @Result(property = "username",  column = "userName"),
           @Result(property = "password",  column = "password")
    })
    User loginUser(@Param("name")String name);

    @Insert("insert into demo.user (userName,password)  values  (#{username},#{password});")
    int registerUser(@Param("username") String username, @Param("password") String password);
}
